package com.yanqu.road.entity.activity.rankunionwar.data;


import com.yanqu.road.utils.string.StringUtils;

import java.math.BigInteger;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class RankUnionWarGuessValueArgs {

	//猜对了几场
	private BigInteger value;

	//轮次变成了轮次加猜对次数优化掉了 //轮次|才对次数=人次;才对次数=人次;才对次数=人次;才对次数=人次;才对次数=人次
	private String param;

	//哪个condition需要触发
	private int conditionId;

	private int turn;

	private Map<Integer,Integer> rightCountUserCountMap = new ConcurrentHashMap<>();

	public RankUnionWarGuessValueArgs(BigInteger value, String param,int conditionId) {
		this.value = value;
		this.param = param;
		this.conditionId = conditionId;

		List<String> tempStringList = StringUtils.stringToStringList(param,"\\|");
		int turn = Integer.valueOf(tempStringList.get(0));
		List<String> tempRightList = StringUtils.stringToStringList(tempStringList.get(1),";");
		//多少场的猜对多少人的
		Map<Integer,Integer> rightCountUserCountMap = new ConcurrentHashMap<>();
		for(String rigStr : tempRightList){
			List<Integer> aaList = StringUtils.stringToIntegerList(rigStr,"=");
			rightCountUserCountMap.put(aaList.get(0),aaList.get(1));
		}
		this.turn = turn;
		this.rightCountUserCountMap = rightCountUserCountMap;
	}

	public BigInteger getValue() {
		return value;
	}

	public void setValue(BigInteger value) {
		this.value = value;
	}

	public String getParam() {
		return param;
	}

	public void setParam(String param) {
		this.param = param;
	}

	public int getConditionId() {
		return conditionId;
	}

	public void setConditionId(int conditionId) {
		this.conditionId = conditionId;
	}

	public int getTurn() {
		return turn;
	}

	public Map<Integer, Integer> getRightCountUserCountMap() {
		return rightCountUserCountMap;
	}
}
